home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 11
/
Cream of the Crop 11-2.iso
/
extra_2
/
starsdos.zip
/
STARS.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1995-10-30
|
1KB
|
64 lines
uses graph,crt;
type
stepup = ^location;
location =
record
x, y : integer;
color : word;
next : stepup;
end;
var
grdriver, grmode : integer;
number, counter : longint;
stars, temp : stepup;
tmp1, tmp2, tmp3 : byte;
first : stepup;
errornum : integer;
begin
if paramcount < 1 then number := 10000 else
begin
val(paramstr(1), number, errornum);
if errornum <> 0 then
begin
writeln('Bad Number');
halt;
end;
end;
grdriver := detect;
initgraph(grdriver, grmode, '');
repeat
new(stars); first := stars;
for counter := 1 to number do
begin
stars^.x := random(getmaxx);
stars^.y := random(getmaxy);
stars^.color := random(getmaxcolor);
putpixel(stars^.x, stars^.y, stars^.color);
temp := stars;
new(stars);
temp^.next := stars;
gotoxy(1,1);
writeln(memavail);
end;
stars := first;
for counter := 1 to number do
begin
putpixel(stars^.x, stars^.y, 0);
temp := stars;
dispose(temp);
stars := stars^.next;
for errornum := 1 to 75 do delay(0);
end;
until keypressed;
closegraph;
end.